# "Human Capital and Climate Change", 
# by Noam Angrist, Kevin Winseck, Harry Patrinos, and Joshua Graff Zivin.

# Inputs:
#   Manually entered coefficients from the output of 4_SecondStage.do
# Outputs:
#   Appendix Figure A4

library(dplyr)
library(ggplot2)

pooled <- c(.019,.030,.008,.003,.028,.021,.016,.005,.016,.033,.029,.027,-.006,.021,.011,.003)
aggregate <- c(.010,.024,.005,.005,.026,.024,.030,.012,.025,.049,.046,.030,-.018,.024,.024,.005)

x <- data.frame(pooled=pooled, aggregate=aggregate)

ggplot(data=x, aes(x=pooled, y=aggregate)) + geom_point() + 
  #geom_line(data=data.frame(pooled=c(-.02,.05), aggregate=c(-.02,.05)), aes(color="red"))+
  geom_line(data=data.frame(pooled=c(-.05,.08), aggregate=c(-.05,.08)), aes(color="red"))+
  theme(legend.position = "none") + xlab("Standard IV Estimate") + ylab("Country-Averaged Treatment Effect") 
#+geom_smooth(method='lm')
cor(x$pooled, x$aggregate)